package com.mijie.fentsi;

import java.io.IOException;
import java.io.StringReader;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.wltea.analyzer.cfg.Configuration;
import org.wltea.analyzer.lucene.IKAnalyzer;
import java.io.BufferedReader;
import org.wltea.analyzer.cfg.DefaultConfig;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.wltea.analyzer.cfg.Configuration;
import org.wltea.analyzer.dic.Dictionary;
import org.wltea.analyzer.dic.Hit;

public class t {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {

		String wordLibs = "c:\\wordFromInputmethod.txt,c:\\word.txt,c:\\ext.txt";
		String sourceTxt = "c:\\sincin.txt";
	//	 sourceTxt="c:\\t.txt";
		String targetTxt = "c:\\fentsiOK.txt";
		
		fentsiOr ftc=new fentsiOr();
	//	 ftc.fentsi(sourceTxt,targetTxt,wordLibs);
		
//	    String string="如果你是一个 现实的人，我想只能用所谓的物质，如果是问我的话，只要你相信，我可能给不了你最好的物质条件，但我会让你每天都开心发自内心的微笑";
//		String r=ftc.fentsi(string, wordLibs);
//		System.out.println(r);
		
		String splitor="\\|";
	 	splitor=splitor.replaceAll("\\\\", "");
		System.out.println(splitor);
		System.out.println("--fnish");
		
		

	}

	// private void loadMainDict(){
	// //建立一个主词典实例
	// _MainDict = new DictSegment((char)0);
	// //读取主词典文件
	// InputStream is =
	// Dictionary.class.getResourceAsStream(Dictionary.PATH_DIC_MAIN);
	// if(is == null){
	// throw new RuntimeException("Main Dictionary not found!!!");
	// }
	//	          
	// try {
	// BufferedReader br = new BufferedReader(new InputStreamReader(is ,
	// "UTF-8"), 512);
	// String theWord = null;
	// do {
	// theWord = br.readLine();
	// if (theWord != null && !"".equals(theWord.trim())) {
	// _MainDict.fillSegment(theWord.trim().toCharArray());
	// }
	// } while (theWord != null);
	//	              
	// } catch (IOException ioe) {
	// System.err.println("Main Dictionary loading exception.");
	// ioe.printStackTrace();
	//	              
	// }finally{
	// try {
	// if(is != null){
	// is.close();
	// is = null;
	// }
	// } catch (IOException e) {
	// e.printStackTrace();
	// }
	// }
	// }

}
